package com.one.group.admin.controller;

import com.one.group.enums.ErrorCode;
import com.one.group.model.vo.FloorManagementVo;
import com.one.group.result.Result;
import com.one.group.service.SpFloorService;
import com.one.group.utils.ResultUtil;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.commons.math3.analysis.function.Floor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/spFloor")
@Tag(name = "楼层接口")
public class SpFloorController {
    @Autowired
    private SpFloorService spFloorService;
    @GetMapping("/list")
    public Result list(Long buildingId){
        List<FloorManagementVo> floorList = spFloorService.mylist(buildingId);
        if (floorList != null){
            return ResultUtil.success(floorList);
        }
        return ResultUtil.error(ErrorCode.OPERATION_ERROR);
    }
}
